

package vistas;

import controladores.controlador_categoria;


public class vista_categoria extends javax.swing.JFrame {

    /** Creates new form vista_categoria */
    public vista_categoria() {
        initComponents();
        cancenlar();
        botones();
    }


     public final void  cancenlar()
    {
        txtCodigo.setText("");
        txtNombre.setText("");
        txtDescripcion.setText("");

    }

       public final void botones()
    {
        controlador_categoria listen = new controlador_categoria(this);
        btnGrabar.addActionListener(listen);
        btnGrabar.setActionCommand("grabar");

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnGrabar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        btnCancelar = new javax.swing.JButton();
        txtCodigo = new javax.swing.JTextField();
        txtNombre = new javax.swing.JTextField();
        txtDescripcion = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Gestionar Categoria");
        getContentPane().setLayout(null);

        btnGrabar.setText("grabar");
        getContentPane().add(btnGrabar);
        btnGrabar.setBounds(90, 240, 110, 30);

        jLabel1.setText("Codigo");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(90, 70, 100, 20);

        jLabel2.setText("nombre");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(90, 100, 100, 18);

        jLabel3.setText("descripcion");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(90, 140, 110, 20);

        btnCancelar.setText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });
        getContentPane().add(btnCancelar);
        btnCancelar.setBounds(210, 240, 110, 30);
        getContentPane().add(txtCodigo);
        txtCodigo.setBounds(180, 60, 140, 28);
        getContentPane().add(txtNombre);
        txtNombre.setBounds(180, 100, 140, 28);
        getContentPane().add(txtDescripcion);
        txtDescripcion.setBounds(180, 140, 140, 90);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-402)/2, (screenSize.height-330)/2, 402, 330);
    }// </editor-fold>//GEN-END:initComponents

    private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
        // TODO add your handling code here:
        cancenlar();
    }//GEN-LAST:event_btnCancelarActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new vista_categoria().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton btnCancelar;
    public javax.swing.JButton btnGrabar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    public javax.swing.JTextField txtCodigo;
    public javax.swing.JTextField txtDescripcion;
    public javax.swing.JTextField txtNombre;
    // End of variables declaration//GEN-END:variables

}
